class Student {
    //属性
    public String name;//姓名
    public int age;    //年龄

    //行为
    public void eat() {
        System.out.println(name+"吃饭！");
    }
    public void sleep() {
        System.out.println(name+"睡觉！");
    }
    public void coding() {
        System.out.println(name+"敲代码！");
    }
}

public class Test {
    public static void main(String[] args) {
        //实例化一个学生对象-student1
        Student student1=new Student();
        student1.name="张三";
        student1.age=20;
        student1.coding();

        //实例化一个学生对象-student2
        Student student2=new Student();
        student2.name="李四";
        student2.age=22;
        student2.coding();
    }
}

